package org.dormi.learn.exp;


/**
 * 分类的异常
 *
 * @author : dormi330
 * @version : 1.0
 */
public class CatalogedException extends RuntimeException {

    public static final Integer TYPE_SERVER = 1;
    public static final Integer TYPE_CLIENT = 2;

    /** client or server */
    protected Integer type;

    protected String code;

    public CatalogedException(Integer type, String code, String message) {
        super(message);
        this.type = type;
        this.code = code;
    }

    public CatalogedException(Integer type, String code, String message, Throwable cause) {
        super(message, cause);
        this.type = type;
        this.code = code;
    }

    /* === constructor === */
    /* === constructor === */
    /* === constructor === */


    /* === set/get === */
    /* === set/get === */
    /* === set/get === */

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getType() {
        return type;
    }

    public CatalogedException setType(Integer type) {
        this.type = type;
        return this;
    }
}
